<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/itemviews/qdirmodel.cpp -->
<head>
  <title>Qt 4.3: QDirModel Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QDirModel Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QDirModel class provides a data model for the local filesystem. <a href="#details">More...</a></p>
<pre> #include &lt;QDirModel&gt;</pre><p>Inherits <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p>
<ul>
<li><a href="qdirmodel-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qdirmodel.html#Roles-enum">Roles</a></b> { FileIconRole, FilePathRole, FileNameRole }</li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<ul>
<li><div class="fn"/><b><a href="qdirmodel.html#lazyChildCount-prop">lazyChildCount</a></b> : bool</li>
<li><div class="fn"/><b><a href="qdirmodel.html#readOnly-prop">readOnly</a></b> : bool</li>
<li><div class="fn"/><b><a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> : bool</li>
</ul>
<ul>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qdirmodel.html#QDirModel">QDirModel</a></b> ( const QStringList &amp; <i>nameFilters</i>, QDir::Filters <i>filters</i>, QDir::SortFlags <i>sort</i>, QObject * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qdirmodel.html#QDirModel-2">QDirModel</a></b> ( QObject * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qdirmodel.html#dtor.QDirModel">~QDirModel</a></b> ()</li>
<li><div class="fn"/>virtual int <b><a href="qdirmodel.html#columnCount">columnCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</li>
<li><div class="fn"/>virtual QVariant <b><a href="qdirmodel.html#data">data</a></b> ( const QModelIndex &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const</li>
<li><div class="fn"/>virtual bool <b><a href="qdirmodel.html#dropMimeData">dropMimeData</a></b> ( const QMimeData * <i>data</i>, Qt::DropAction <i>action</i>, int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> )</li>
<li><div class="fn"/>QIcon <b><a href="qdirmodel.html#fileIcon">fileIcon</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>QFileInfo <b><a href="qdirmodel.html#fileInfo">fileInfo</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>QString <b><a href="qdirmodel.html#fileName">fileName</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>QString <b><a href="qdirmodel.html#filePath">filePath</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>QDir::Filters <b><a href="qdirmodel.html#filter">filter</a></b> () const</li>
<li><div class="fn"/>virtual Qt::ItemFlags <b><a href="qdirmodel.html#flags">flags</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>virtual bool <b><a href="qdirmodel.html#hasChildren">hasChildren</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</li>
<li><div class="fn"/>virtual QVariant <b><a href="qdirmodel.html#headerData">headerData</a></b> ( int <i>section</i>, Qt::Orientation <i>orientation</i>, int <i>role</i> = Qt::DisplayRole ) const</li>
<li><div class="fn"/>QFileIconProvider * <b><a href="qdirmodel.html#iconProvider">iconProvider</a></b> () const</li>
<li><div class="fn"/>virtual QModelIndex <b><a href="qdirmodel.html#index">index</a></b> ( int <i>row</i>, int <i>column</i>, const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</li>
<li><div class="fn"/>QModelIndex <b><a href="qdirmodel.html#index-2">index</a></b> ( const QString &amp; <i>path</i>, int <i>column</i> = 0 ) const</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#isDir">isDir</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#readOnly-prop">isReadOnly</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#lazyChildCount-prop">lazyChildCount</a></b> () const</li>
<li><div class="fn"/>virtual QMimeData * <b><a href="qdirmodel.html#mimeData">mimeData</a></b> ( const QModelIndexList &amp; <i>indexes</i> ) const</li>
<li><div class="fn"/>virtual QStringList <b><a href="qdirmodel.html#mimeTypes">mimeTypes</a></b> () const</li>
<li><div class="fn"/>QModelIndex <b><a href="qdirmodel.html#mkdir">mkdir</a></b> ( const QModelIndex &amp; <i>parent</i>, const QString &amp; <i>name</i> )</li>
<li><div class="fn"/>QStringList <b><a href="qdirmodel.html#nameFilters">nameFilters</a></b> () const</li>
<li><div class="fn"/>virtual QModelIndex <b><a href="qdirmodel.html#parent">parent</a></b> ( const QModelIndex &amp; <i>child</i> ) const</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#remove">remove</a></b> ( const QModelIndex &amp; <i>index</i> )</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qdirmodel.html#rmdir">rmdir</a></b> ( const QModelIndex &amp; <i>index</i> )</li>
<li><div class="fn"/>virtual int <b><a href="qdirmodel.html#rowCount">rowCount</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() ) const</li>
<li><div class="fn"/>virtual bool <b><a href="qdirmodel.html#setData">setData</a></b> ( const QModelIndex &amp; <i>index</i>, const QVariant &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#setFilter">setFilter</a></b> ( QDir::Filters <i>filters</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#setIconProvider">setIconProvider</a></b> ( QFileIconProvider * <i>provider</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#lazyChildCount-prop">setLazyChildCount</a></b> ( bool <i>enable</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#setNameFilters">setNameFilters</a></b> ( const QStringList &amp; <i>filters</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#readOnly-prop">setReadOnly</a></b> ( bool <i>enable</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#resolveSymlinks-prop">setResolveSymlinks</a></b> ( bool <i>enable</i> )</li>
<li><div class="fn"/>void <b><a href="qdirmodel.html#setSorting">setSorting</a></b> ( QDir::SortFlags <i>sort</i> )</li>
<li><div class="fn"/>virtual void <b><a href="qdirmodel.html#sort">sort</a></b> ( int <i>column</i>, Qt::SortOrder <i>order</i> = Qt::AscendingOrder )</li>
<li><div class="fn"/>QDir::SortFlags <b><a href="qdirmodel.html#sorting">sorting</a></b> () const</li>
<li><div class="fn"/>virtual Qt::DropActions <b><a href="qdirmodel.html#supportedDropActions">supportedDropActions</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>34 public functions inherited from <a href="qabstractitemmodel.html#public-functions">QAbstractItemModel</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h3>Public Slots</h3>
<ul>
<li><div class="fn"/>void <b><a href="qdirmodel.html#refresh">refresh</a></b> ( const QModelIndex &amp; <i>parent</i> = QModelIndex() )</li>
</ul>
<ul>
<li><div class="fn"/>2 public slots inherited from <a href="qabstractitemmodel.html#public-slots">QAbstractItemModel</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>14 signals inherited from <a href="qabstractitemmodel.html#signals">QAbstractItemModel</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>14 protected functions inherited from <a href="qabstractitemmodel.html#protected-functions">QAbstractItemModel</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QDirModel class provides a data model for the local filesystem.</p>
<p>This class provides access to the local filesystem, providing functions for renaming and removing files and directories, and for creating new directories. In the simplest case, it can be used with a suitable display widget as part of a browser or filer.</p>
<p>QDirModel keeps a cache with file information. The cache needs to be updated with <a href="qdirmodel.html#refresh">refresh</a>().</p>
<p>A directory model that displays the contents of a default directory is usually constructed with a parent object:</p>
<pre>     QDirModel *model = new QDirModel;</pre>
<p>A tree view can be used to display the contents of the model</p>
<pre>     QTreeView *tree = new QTreeView(splitter);
     tree-&gt;setModel(model);</pre>
<p>and the contents of a particular directory can be displayed by setting the tree view's root index:</p>
<pre>     tree-&gt;setRootIndex(model-&gt;index(QDir::currentPath()));</pre>
<p>The view's root index can be used to control how much of a hierarchical model is displayed. QDirModel provides a convenience function that returns a suitable model index for a path to a directory within the model.</p>
<p>QDirModel can be accessed using the standard interface provided by <a href="qabstractitemmodel.html">QAbstractItemModel</a>, but it also provides some convenience functions that are specific to a directory model. The <a href="qdirmodel.html#fileInfo">fileInfo</a>(), <a href="qdirmodel.html#isDir">isDir</a>(), <a href="qobject-qt3.html#name">name</a>(), and path() functions provide information about the underlying files and directories related to items in the model. Directories can be created and removed using <a href="qdirmodel.html#mkdir">mkdir</a>(), <a href="qdirmodel.html#rmdir">rmdir</a>(), and the model will be automatically updated to take the changes into account.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>(), <a href="qdirmodel.html#setFilter">setFilter</a>(), <a href="qdirmodel.html#filter">filter</a>(), <a href="qlistview.html">QListView</a>, <a href="qtreeview.html">QTreeView</a>, <a href="itemviews-dirview.html">Dir View Example</a>, and <a href="model-view-model.html">Model Classes</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="Roles-enum"></a>enum QDirModel::Roles</h3>
<p><table border="1" cellpadding="2" cellspacing="1" width="40%">
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
<tr><td valign="top"><tt>QDirModel::FileIconRole</tt></td><td align="center" valign="top"><tt>Qt::DecorationRole</tt></td></tr>
<tr><td valign="top"><tt>QDirModel::FilePathRole</tt></td><td align="center" valign="top"><tt>Qt::UserRole + 1</tt></td></tr>
<tr><td valign="top"><tt>QDirModel::FileNameRole</tt></td><td align="center" valign="top">?</td></tr>
</table></p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="lazyChildCount-prop"></a>lazyChildCount : bool</h3>
<p>This property holds whether the directory model optimizes the hasChildren function to only check if the item is a directory.</p>
<p>If this property is set to false, the directory model will make sure that a directory actually containes any files before reporting that it has children. Otherwise the directory model will report that an item has children if the item is a directory.</p>
<p>This property is false by default</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool lazyChildCount () const</b></li>
<li><div class="fn"/><b>void setLazyChildCount ( bool <i>enable</i> )</b></li>
</ul>
<h3 class="fn"><a name="readOnly-prop"></a>readOnly : bool</h3>
<p>This property holds whether the directory model allows writing to the file system.</p>
<p>If this property is set to false, the directory model will allow renaming, copying and deleting of files and directories.</p>
<p>This property is true by default</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool isReadOnly () const</b></li>
<li><div class="fn"/><b>void setReadOnly ( bool <i>enable</i> )</b></li>
</ul>
<h3 class="fn"><a name="resolveSymlinks-prop"></a>resolveSymlinks : bool</h3>
<p>This property holds whether the directory model should resolve symbolic links.</p>
<p>This is only relevant on operating systems that support symbolic links.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool resolveSymlinks () const</b></li>
<li><div class="fn"/><b>void setResolveSymlinks ( bool <i>enable</i> )</b></li>
</ul>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QDirModel"></a>QDirModel::QDirModel ( const <a href="qstringlist.html">QStringList</a> &amp; <i>nameFilters</i>, <a href="qdir.html#Filter-enum">QDir::Filters</a> <i>filters</i>, <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> <i>sort</i>, <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new directory model with the given <i>parent</i>. Only those files matching the <i>nameFilters</i> and the <i>filters</i> are included in the model. The sort order is given by the <i>sort</i> flags.</p>
<h3 class="fn"><a name="QDirModel-2"></a>QDirModel::QDirModel ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a directory model with the given <i>parent</i>.</p>
<h3 class="fn"><a name="dtor.QDirModel"></a>QDirModel::~QDirModel ()</h3>
<p>Destroys this directory model.</p>
<h3 class="fn"><a name="columnCount"></a>int QDirModel::columnCount ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the number of columns in the <i>parent</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="data"></a><a href="qvariant.html">QVariant</a> QDirModel::data ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i>, int <i>role</i> = Qt::DisplayRole ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the data for the model item <i>index</i> with the given <i>role</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#setData">setData</a>().</p>
<h3 class="fn"><a name="dropMimeData"></a>bool QDirModel::dropMimeData ( const <a href="qmimedata.html">QMimeData</a> * <i>data</i>, <a href="qt.html#DropAction-enum">Qt::DropAction</a> <i>action</i>, int <i>row</i>, int <i>column</i>, const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Handles the <i>data</i> supplied by a drag and drop operation that ended with the given <i>action</i> over the row in the model specified by the <i>row</i> and <i>column</i> and by the <i>parent</i> index.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#dropMimeData">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#supportedDropActions">supportedDropActions</a>().</p>
<h3 class="fn"><a name="fileIcon"></a><a href="qicon.html">QIcon</a> QDirModel::fileIcon ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the icons for the item stored in the model under the given <i>index</i>.</p>
<h3 class="fn"><a name="fileInfo"></a><a href="qfileinfo.html">QFileInfo</a> QDirModel::fileInfo ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the file information for the specified model <i>index</i>.</p>
<p><b>Note:</b> If the model index represents a symbolic link in the underlying filing system, the file information returned will contain information about the symbolic link itself, regardless of whether <a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a> is enabled or not.</p>
<p>See also <a href="qfileinfo.html#symLinkTarget">QFileInfo::symLinkTarget</a>().</p>
<h3 class="fn"><a name="fileName"></a><a href="qstring.html">QString</a> QDirModel::fileName ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the name of the item stored in the model under the <i>index</i> given.</p>
<h3 class="fn"><a name="filePath"></a><a href="qstring.html">QString</a> QDirModel::filePath ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns the path of the item stored in the model under the <i>index</i> given.</p>
<h3 class="fn"><a name="filter"></a><a href="qdir.html#Filter-enum">QDir::Filters</a> QDirModel::filter () const</h3>
<p>Returns the filter specification for the directory model.</p>
<p>See also <a href="qdirmodel.html#setFilter">setFilter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<h3 class="fn"><a name="flags"></a><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a> QDirModel::flags ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the item flags for the given <i>index</i> in the model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel</a>.</p>
<p>See also <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>.</p>
<h3 class="fn"><a name="hasChildren"></a>bool QDirModel::hasChildren ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns true if the <i>parent</i> model item has children; otherwise returns false.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="headerData"></a><a href="qvariant.html">QVariant</a> QDirModel::headerData ( int <i>section</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, int <i>role</i> = Qt::DisplayRole ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the data stored under the given <i>role</i> for the specified <i>section</i> of the header with the given <i>orientation</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="iconProvider"></a><a href="qfileiconprovider.html">QFileIconProvider</a> * QDirModel::iconProvider () const</h3>
<p>Returns the file icon provider for this directory model.</p>
<p>See also <a href="qdirmodel.html#setIconProvider">setIconProvider</a>().</p>
<h3 class="fn"><a name="index"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::index ( int <i>row</i>, int <i>column</i>, const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the model item index for the item in the <i>parent</i> with the given <i>row</i> and <i>column</i>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="index-2"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::index ( const <a href="qstring.html">QString</a> &amp; <i>path</i>, int <i>column</i> = 0 ) const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns the model item index for the given <i>path</i>.</p>
<h3 class="fn"><a name="isDir"></a>bool QDirModel::isDir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const</h3>
<p>Returns true if the model item <i>index</i> represents a directory; otherwise returns false.</p>
<h3 class="fn"><a name="mimeData"></a><a href="qmimedata.html">QMimeData</a> * QDirModel::mimeData ( const <a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a> &amp; <i>indexes</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns an object that contains a serialized description of the specified <i>indexes</i>. The format used to describe the items corresponding to the indexes is obtained from the <a href="qdirmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, 0 is returned rather than a serialized empty list.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="mimeTypes"></a><a href="qstringlist.html">QStringList</a> QDirModel::mimeTypes () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns a list of MIME types that can be used to describe a list of items in the model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="mkdir"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::mkdir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i>, const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
<p>Create a directory with the <i>name</i> in the <i>parent</i> model item.</p>
<h3 class="fn"><a name="nameFilters"></a><a href="qstringlist.html">QStringList</a> QDirModel::nameFilters () const</h3>
<p>Returns a list of filters applied to the names in the model.</p>
<p>See also <a href="qdirmodel.html#setNameFilters">setNameFilters</a>().</p>
<h3 class="fn"><a name="parent"></a><a href="qmodelindex.html">QModelIndex</a> QDirModel::parent ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>child</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Return the parent of the given <i>child</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="refresh"></a>void QDirModel::refresh ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p><a href="qdirmodel.html">QDirModel</a> caches file information. This function updates the cache. The <i>parent</i> parameter is the directory from which the model is updated; the default value will update the model from root directory of the file system (the entire model).</p>
<h3 class="fn"><a name="remove"></a>bool QDirModel::remove ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> )</h3>
<p>Removes the model item <i>index</i> from the directory model and <b>deletes the corresponding file from the file system</b>, returning true if successful. If the item cannot be removed, false is returned.</p>
<p><b>Warning:</b> This function deletes files from the file system; it does <b>not</b> move them to a location where they can be recovered.</p>
<p>See also <a href="qdirmodel.html#rmdir">rmdir</a>().</p>
<h3 class="fn"><a name="rmdir"></a>bool QDirModel::rmdir ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> )</h3>
<p>Removes the directory corresponding to the model item <i>index</i> in the directory model and <b>deletes the corresponding directory from the file system</b>, returning true if successful. If the directory cannot be removed, false is returned.</p>
<p><b>Warning:</b> This function deletes directories from the file system; it does <b>not</b> move them to a location where they can be recovered.</p>
<p>See also <a href="qdirmodel.html#remove">remove</a>().</p>
<h3 class="fn"><a name="rowCount"></a>int QDirModel::rowCount ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>parent</i> = QModelIndex() ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the number of rows in the <i>parent</i> model item.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="setData"></a>bool QDirModel::setData ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i>, int <i>role</i> = Qt::EditRole )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the data for the model item <i>index</i> with the given <i>role</i> to the data referenced by the <i>value</i>. Returns true if successful; otherwise returns false.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel</a>.</p>
<p>See also <a href="qdirmodel.html#data">data</a>() and <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>.</p>
<h3 class="fn"><a name="setFilter"></a>void QDirModel::setFilter ( <a href="qdir.html#Filter-enum">QDir::Filters</a> <i>filters</i> )</h3>
<p>Sets the directory model's filter to that specified by <i>filters</i>.</p>
<p>Note that the filter you set should always include the <a href="qdir.html#Filter-enum">QDir::AllDirs</a> enum value, otherwise <a href="qdirmodel.html">QDirModel</a> won't be able to read the directory structure.</p>
<p>See also <a href="qdirmodel.html#filter">filter</a>() and <a href="qdir.html#Filter-enum">QDir::Filters</a>.</p>
<h3 class="fn"><a name="setIconProvider"></a>void QDirModel::setIconProvider ( <a href="qfileiconprovider.html">QFileIconProvider</a> * <i>provider</i> )</h3>
<p>Sets the <i>provider</i> of file icons for the directory model.</p>
<p>See also <a href="qdirmodel.html#iconProvider">iconProvider</a>().</p>
<h3 class="fn"><a name="setNameFilters"></a>void QDirModel::setNameFilters ( const <a href="qstringlist.html">QStringList</a> &amp; <i>filters</i> )</h3>
<p>Sets the name <i>filters</i> for the directory model.</p>
<p>See also <a href="qdirmodel.html#nameFilters">nameFilters</a>().</p>
<h3 class="fn"><a name="setSorting"></a>void QDirModel::setSorting ( <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> <i>sort</i> )</h3>
<p>Sets the directory model's sorting order to that specified by <i>sort</i>.</p>
<p>See also <a href="qdirmodel.html#sorting">sorting</a>() and <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a>.</p>
<h3 class="fn"><a name="sort"></a>void QDirModel::sort ( int <i>column</i>, <a href="qt.html#SortOrder-enum">Qt::SortOrder</a> <i>order</i> = Qt::AscendingOrder )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sort the model items in the <i>column</i> using the <i>order</i> given. The order is a value defined in <a href="qt.html#SortOrder-enum">Qt::SortOrder</a>.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel</a>.</p>
<h3 class="fn"><a name="sorting"></a><a href="qdir.html#SortFlag-enum">QDir::SortFlags</a> QDirModel::sorting () const</h3>
<p>Returns the sorting method used for the directory model.</p>
<p>See also <a href="qdirmodel.html#setSorting">setSorting</a>() and <a href="qdir.html#SortFlag-enum">QDir::SortFlags</a>.</p>
<h3 class="fn"><a name="supportedDropActions"></a><a href="qt.html#DropAction-enum">Qt::DropActions</a> QDirModel::supportedDropActions () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the drop actions supported by this model.</p>
<p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel</a>.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt::DropActions</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
